import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
var _excluded = ["status"],
    _excluded2 = ["roleId"],
    _excluded3 = ["roleId"],
    _excluded4 = ["roleId", "secGrpId"],
    _excluded5 = ["roleId", "secGrpId"];

/**
 * roleManagementService - 角色管理service
 * 使用了 平台 CPAAS_PLATFORM 的接口 (查询角色分配的卡片)
 * @date: 2018-7-24

 */
import qs from 'querystring';
import request from 'utils/request';
import { CPAAS_IAM, CPAAS_PLATFORM } from 'utils/config';
import { getCurrentOrganizationId, parseParameters, filterNullValueObject, isTenantRoleLevel } from 'utils/utils';
var tenantId = getCurrentOrganizationId();
var organizationRoleLevel = isTenantRoleLevel();

function memberRoleClient() {
  return isTenantRoleLevel() ? "".concat(tenantId, "/member-roles/role-clients") : 'member-roles/role-clients';
}

function clientDel() {
  return isTenantRoleLevel() ? "".concat(tenantId, "/member-roles/batch-delete") : 'member-roles/batch-delete';
}

function clientAdd() {
  return isTenantRoleLevel() ? "".concat(tenantId, "/member-roles/batch-assign") : 'member-roles/batch-assign';
}

function enableStatus(status) {
  return status ? 'enable' : 'disable';
}

var secGrp = organizationRoleLevel ? "v1/".concat(tenantId, "/sec-grp-role-assign") : "v1/sec-grp-role-assign";
/**
 * 查询值集
 * @async
 * @function queryCode
 * @param {object} params - 查询条件
 * @param {!string} param.lovCode - 查询条件
 * @returns {object} fetch Promise
 */

export function queryCode() {
  return _queryCode.apply(this, arguments);
}
/**
 * 查询值集
 * @async
 * @function queryCode
 * @param {!number} id - 角色ID
 * @param {!boolean} [status=false] - 启用或停用
 * @returns {object} fetch Promise
 */

function _queryCode() {
  _queryCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
    var params,
        _args = arguments;
    return _regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
            return _context.abrupt("return", request("".concat(CPAAS_PLATFORM, "/v1/lovs/value"), {
              query: params
            }));

          case 2:
          case "end":
            return _context.stop();
        }
      }
    }, _callee);
  }));
  return _queryCode.apply(this, arguments);
}

export function enableRole(_x) {
  return _enableRole.apply(this, arguments);
}
/**
 * 查询值集
 * @async
 * @function queryCode
 * @param {!number} id - 角色ID
 * @param {!boolean} [status=false] - 启用或停用
 * @returns {object} fetch Promise
 */

function _enableRole() {
  _enableRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(params) {
    var status, others;
    return _regeneratorRuntime.wrap(function _callee2$(_context2) {
      while (1) {
        switch (_context2.prev = _context2.next) {
          case 0:
            status = params.status, others = _objectWithoutProperties(params, _excluded);
            return _context2.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/cpaas/v1/").concat(tenantId, "/roles/").concat(enableStatus(status)) : "".concat(CPAAS_IAM, "/cpaas/v1/roles/").concat(enableStatus(status)), {
              method: 'PUT',
              body: others
            }));

          case 2:
          case "end":
            return _context2.stop();
        }
      }
    }, _callee2);
  }));
  return _enableRole.apply(this, arguments);
}

export function enableOrganizationRole(_x2, _x3) {
  return _enableOrganizationRole.apply(this, arguments);
}
/**
 * 通过类型查询label
 * @async
 * @function queryLabels
 * @param {object} params - 角色ID
 * @param {!boolean} [status=false] - 启用或停用
 * @returns {object} fetch Promise
 */

function _enableOrganizationRole() {
  _enableOrganizationRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(_ref, organizationId) {
    var id, status;
    return _regeneratorRuntime.wrap(function _callee3$(_context3) {
      while (1) {
        switch (_context3.prev = _context3.next) {
          case 0:
            id = _ref.id, status = _ref.status;
            return _context3.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/roles/").concat(id, "/").concat(enableStatus(status)), {
              method: 'PUT',
              responseType: 'text'
            }));

          case 2:
          case "end":
            return _context3.stop();
        }
      }
    }, _callee3);
  }));
  return _enableOrganizationRole.apply(this, arguments);
}

export function queryLabels(_x4) {
  return _queryLabels.apply(this, arguments);
}
/**
 * 通过类型查询label
 * @async
 * @function queryLabels
 * @param {object} params - 角色ID
 * @param {!boolean} [status=false] - 启用或停用
 * @returns {object} fetch Promise
 */

function _queryLabels() {
  _queryLabels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(params) {
    return _regeneratorRuntime.wrap(function _callee4$(_context4) {
      while (1) {
        switch (_context4.prev = _context4.next) {
          case 0:
            return _context4.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/v1/").concat(tenantId, "/labels") : "".concat(CPAAS_IAM, "/v1/labels"), {
              query: params
            }));

          case 1:
          case "end":
            return _context4.stop();
        }
      }
    }, _callee4);
  }));
  return _queryLabels.apply(this, arguments);
}

export function queryRoleLabel(_x5) {
  return _queryRoleLabel.apply(this, arguments);
}
/**
 * 通过层级查询label
 * @async
 * @function queryLabelList
 * @param {object} params - 角色ID
 * @param {!boolean} [status=false] - 启用或停用
 * @returns {object} fetch Promise
 */

function _queryRoleLabel() {
  _queryRoleLabel = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(params) {
    return _regeneratorRuntime.wrap(function _callee5$(_context5) {
      while (1) {
        switch (_context5.prev = _context5.next) {
          case 0:
            return _context5.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/v1/").concat(tenantId, "/label-rels/ROLE/").concat(params) : "".concat(CPAAS_IAM, "/v1/label-rels/ROLE/").concat(params), {}));

          case 1:
          case "end":
            return _context5.stop();
        }
      }
    }, _callee5);
  }));
  return _queryRoleLabel.apply(this, arguments);
}

export function queryLabelList(_x6) {
  return _queryLabelList.apply(this, arguments);
}
/**
 * 通过id查询角色
 * @async
 * @function queryRole
 * @param {!number} roleId - 角色ID
 * @returns {object} fetch Promise
 */

function _queryLabelList() {
  _queryLabelList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(params) {
    return _regeneratorRuntime.wrap(function _callee6$(_context6) {
      while (1) {
        switch (_context6.prev = _context6.next) {
          case 0:
            return _context6.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/v1/").concat(tenantId, "/labels/by-type") : "".concat(CPAAS_IAM, "/v1/labels/by-type"), {
              query: params,
              method: 'GET'
            }));

          case 1:
          case "end":
            return _context6.stop();
        }
      }
    }, _callee6);
  }));
  return _queryLabelList.apply(this, arguments);
}

export function queryRole(_x7) {
  return _queryRole.apply(this, arguments);
}
/**
 * 通过id查询角色 - 租户级
 * @async
 * @function queryOrganizationRole
 * @param {!number} roleId - 角色ID
 * @returns {object} fetch Promise
 */

function _queryRole() {
  _queryRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(roleId) {
    return _regeneratorRuntime.wrap(function _callee7$(_context7) {
      while (1) {
        switch (_context7.prev = _context7.next) {
          case 0:
            return _context7.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/cpaas/v1/").concat(tenantId, "/roles/").concat(roleId) : "".concat(CPAAS_IAM, "/cpaas/v1/roles/").concat(roleId)));

          case 1:
          case "end":
            return _context7.stop();
        }
      }
    }, _callee7);
  }));
  return _queryRole.apply(this, arguments);
}

export function queryOrganizationRole(_x8, _x9) {
  return _queryOrganizationRole.apply(this, arguments);
}
/**
 * 查询角色可分配权限集子树
 * @async
 * @function queryLevelPermissions
 * @param {!number} roleId - 角色ID
 * @param {object} params - 查询条件
 * @param {!number} [params.page = 0] - 数据页码
 * @param {!number} [params.size = 10] - 分页大小
 * @returns {object} fetch Promise
 */

function _queryOrganizationRole() {
  _queryOrganizationRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(roleId, organizationId) {
    return _regeneratorRuntime.wrap(function _callee8$(_context8) {
      while (1) {
        switch (_context8.prev = _context8.next) {
          case 0:
            return _context8.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/roles/").concat(roleId)));

          case 1:
          case "end":
            return _context8.stop();
        }
      }
    }, _callee8);
  }));
  return _queryOrganizationRole.apply(this, arguments);
}

export function queryPermissionSets(_x10) {
  return _queryPermissionSets.apply(this, arguments);
}
/**
 * 分页查询角色对应层级的权限
 * @async
 * @function queryLevelPermissions
 * @param {!number} roleId - 角色ID
 * @param {object} params - 查询条件
 * @param {!number} [params.page = 0] - 数据页码
 * @param {!number} [params.size = 10] - 分页大小
 * @returns {object} fetch Promise
 */

function _queryPermissionSets() {
  _queryPermissionSets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(roleId) {
    var params,
        _args9 = arguments;
    return _regeneratorRuntime.wrap(function _callee9$(_context9) {
      while (1) {
        switch (_context9.prev = _context9.next) {
          case 0:
            params = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : {};
            return _context9.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/cpaas/v1/").concat(tenantId, "/roles/").concat(roleId, "/permission-sets") : "".concat(CPAAS_IAM, "/cpaas/v1/roles/").concat(roleId, "/permission-sets"), {
              query: params
            }));

          case 2:
          case "end":
            return _context9.stop();
        }
      }
    }, _callee9);
  }));
  return _queryPermissionSets.apply(this, arguments);
}

export function queryLevelPermissions(_x11) {
  return _queryLevelPermissions.apply(this, arguments);
}
/**
 * 分页查询角色对应层级的权限 - 租户级
 * @async
 * @function queryOrganizationLevelPermissions
 * @param {!number} roleId - 角色ID
 * @param {!number} organizationId - 组织ID
 * @param {object} params - 查询条件
 * @param {!number} [params.page = 0] - 数据页码
 * @param {!number} [params.size = 10] - 分页大小
 * @returns {object} fetch Promise
 */

function _queryLevelPermissions() {
  _queryLevelPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee10(roleId) {
    var params,
        _args10 = arguments;
    return _regeneratorRuntime.wrap(function _callee10$(_context10) {
      while (1) {
        switch (_context10.prev = _context10.next) {
          case 0:
            params = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {};
            return _context10.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/permissions/").concat(roleId), {
              query: params
            }));

          case 2:
          case "end":
            return _context10.stop();
        }
      }
    }, _callee10);
  }));
  return _queryLevelPermissions.apply(this, arguments);
}

export function queryOrganizationLevelPermissions(_x12) {
  return _queryOrganizationLevelPermissions.apply(this, arguments);
}
/**
 * 创建角色
 * @async
 * @function createRole
 * @param {!object} params - 保存参数
 * @returns {object} fetch Promise
 */

function _queryOrganizationLevelPermissions() {
  _queryOrganizationLevelPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee11(roleId) {
    var params,
        organizationId,
        _args11 = arguments;
    return _regeneratorRuntime.wrap(function _callee11$(_context11) {
      while (1) {
        switch (_context11.prev = _context11.next) {
          case 0:
            params = _args11.length > 1 && _args11[1] !== undefined ? _args11[1] : {};
            organizationId = _args11.length > 2 ? _args11[2] : undefined;
            return _context11.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/permissions/").concat(roleId), {
              query: params
            }));

          case 3:
          case "end":
            return _context11.stop();
        }
      }
    }, _callee11);
  }));
  return _queryOrganizationLevelPermissions.apply(this, arguments);
}

export function createRole(_x13) {
  return _createRole.apply(this, arguments);
}
/**
 * 创建角色 - 租户级
 * @async
 * @function createOrganizationRole
 * @param {!number} organizationId - 组织ID
 * @param {!object} params - 保存参数
 * @returns {object} fetch Promise
 */

function _createRole() {
  _createRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee12(params) {
    return _regeneratorRuntime.wrap(function _callee12$(_context12) {
      while (1) {
        switch (_context12.prev = _context12.next) {
          case 0:
            return _context12.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles"), {
              method: 'POST',
              body: params
            }));

          case 1:
          case "end":
            return _context12.stop();
        }
      }
    }, _callee12);
  }));
  return _createRole.apply(this, arguments);
}

export function createOrganizationRole(_x14, _x15) {
  return _createOrganizationRole.apply(this, arguments);
}
/**
 * 修改角色
 * @async
 * @function editRole
 * @param {!object} params - 保存参数
 * @returns {object} fetch Promise
 */

function _createOrganizationRole() {
  _createOrganizationRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee13(params, organizationId) {
    return _regeneratorRuntime.wrap(function _callee13$(_context13) {
      while (1) {
        switch (_context13.prev = _context13.next) {
          case 0:
            return _context13.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/roles"), {
              method: 'POST',
              body: params
            }));

          case 1:
          case "end":
            return _context13.stop();
        }
      }
    }, _callee13);
  }));
  return _createOrganizationRole.apply(this, arguments);
}

export function editRole(_x16) {
  return _editRole.apply(this, arguments);
}
/**
 * 修改角色 - 租户级
 * @async
 * @function editOrganizationRole
 * @param {!number} organizationId - 组织ID
 * @param {!object} params - 保存参数
 * @returns {object} fetch Promise
 */

function _editRole() {
  _editRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee14(params) {
    return _regeneratorRuntime.wrap(function _callee14$(_context14) {
      while (1) {
        switch (_context14.prev = _context14.next) {
          case 0:
            return _context14.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles"), {
              method: 'PUT',
              body: params
            }));

          case 1:
          case "end":
            return _context14.stop();
        }
      }
    }, _callee14);
  }));
  return _editRole.apply(this, arguments);
}

export function editOrganizationRole(_x17, _x18) {
  return _editOrganizationRole.apply(this, arguments);
}
/**
 * 复制并创建角色
 * @async
 * @function copyRole
 * @param {!object} params - 保存参数
 * @returns {object} fetch Promise
 */

function _editOrganizationRole() {
  _editOrganizationRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee15(params, organizationId) {
    return _regeneratorRuntime.wrap(function _callee15$(_context15) {
      while (1) {
        switch (_context15.prev = _context15.next) {
          case 0:
            return _context15.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/roles"), {
              method: 'PUT',
              body: params
            }));

          case 1:
          case "end":
            return _context15.stop();
        }
      }
    }, _callee15);
  }));
  return _editOrganizationRole.apply(this, arguments);
}

export function copyRole(_x19) {
  return _copyRole.apply(this, arguments);
}
/**
 * 复制并创建角色 - 租户级
 * @async
 * @function copyOrganizationRole
 * @param {!number} organizationId - 组织ID
 * @param {!object} params - 保存参数
 * @returns {object} fetch Promise
 */

function _copyRole() {
  _copyRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee16(params) {
    return _regeneratorRuntime.wrap(function _callee16$(_context16) {
      while (1) {
        switch (_context16.prev = _context16.next) {
          case 0:
            return _context16.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles/copy"), {
              method: 'POST',
              body: params
            }));

          case 1:
          case "end":
            return _context16.stop();
        }
      }
    }, _callee16);
  }));
  return _copyRole.apply(this, arguments);
}

export function copyOrganizationRole(_x20, _x21) {
  return _copyOrganizationRole.apply(this, arguments);
}
/**
 * 继承并创建角色
 * @async
 * @function inheritRole
 * @param {!object} params - 保存参数
 * @returns {object} fetch Promise
 */

function _copyOrganizationRole() {
  _copyOrganizationRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee17(params, organizationId) {
    return _regeneratorRuntime.wrap(function _callee17$(_context17) {
      while (1) {
        switch (_context17.prev = _context17.next) {
          case 0:
            return _context17.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/roles/copy"), {
              method: 'POST',
              body: params
            }));

          case 1:
          case "end":
            return _context17.stop();
        }
      }
    }, _callee17);
  }));
  return _copyOrganizationRole.apply(this, arguments);
}

export function inheritRole(_x22) {
  return _inheritRole.apply(this, arguments);
}
/**
 * 继承并创建角色 - 租户级
 * @async
 * @function inheritOrganizationRole
 * @param {!number} organizationId - 组织ID
 * @param {!object} params - 保存参数
 * @returns {object} fetch Promise
 */

function _inheritRole() {
  _inheritRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee18(params) {
    return _regeneratorRuntime.wrap(function _callee18$(_context18) {
      while (1) {
        switch (_context18.prev = _context18.next) {
          case 0:
            return _context18.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles/inherit"), {
              method: 'POST',
              body: params
            }));

          case 1:
          case "end":
            return _context18.stop();
        }
      }
    }, _callee18);
  }));
  return _inheritRole.apply(this, arguments);
}

export function inheritOrganizationRole(_x23, _x24) {
  return _inheritOrganizationRole.apply(this, arguments);
}

function _inheritOrganizationRole() {
  _inheritOrganizationRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee19(params, organizationId) {
    return _regeneratorRuntime.wrap(function _callee19$(_context19) {
      while (1) {
        switch (_context19.prev = _context19.next) {
          case 0:
            return _context19.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/roles/inherit"), {
              method: 'POST',
              body: params
            }));

          case 1:
          case "end":
            return _context19.stop();
        }
      }
    }, _callee19);
  }));
  return _inheritOrganizationRole.apply(this, arguments);
}

export function queryHrunitsTree() {
  return _queryHrunitsTree.apply(this, arguments);
}

function _queryHrunitsTree() {
  _queryHrunitsTree = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee20() {
    var params,
        _args20 = arguments;
    return _regeneratorRuntime.wrap(function _callee20$(_context20) {
      while (1) {
        switch (_context20.prev = _context20.next) {
          case 0:
            params = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : {};
            return _context20.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/cpaas/v1/").concat(tenantId, "/hrunits/tree") : "".concat(CPAAS_IAM, "/cpaas/v1/hrunits/tree"), {
              query: params
            }));

          case 2:
          case "end":
            return _context20.stop();
        }
      }
    }, _callee20);
  }));
  return _queryHrunitsTree.apply(this, arguments);
}

export function queryMemberRolesUsers() {
  return _queryMemberRolesUsers.apply(this, arguments);
}

function _queryMemberRolesUsers() {
  _queryMemberRolesUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee21() {
    var params,
        roleId,
        _args21 = arguments;
    return _regeneratorRuntime.wrap(function _callee21$(_context21) {
      while (1) {
        switch (_context21.prev = _context21.next) {
          case 0:
            params = _args21.length > 0 && _args21[0] !== undefined ? _args21[0] : {};
            roleId = params.roleId;
            return _context21.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/member-roles/role-users/").concat(roleId), {
              query: params
            }));

          case 3:
          case "end":
            return _context21.stop();
        }
      }
    }, _callee21);
  }));
  return _queryMemberRolesUsers.apply(this, arguments);
}

export function queryOrganizationMemberRolesUsers() {
  return _queryOrganizationMemberRolesUsers.apply(this, arguments);
}

function _queryOrganizationMemberRolesUsers() {
  _queryOrganizationMemberRolesUsers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee22() {
    var params,
        organizationId,
        roleId,
        _args22 = arguments;
    return _regeneratorRuntime.wrap(function _callee22$(_context22) {
      while (1) {
        switch (_context22.prev = _context22.next) {
          case 0:
            params = _args22.length > 0 && _args22[0] !== undefined ? _args22[0] : {};
            organizationId = _args22.length > 1 ? _args22[1] : undefined;
            roleId = params.roleId;
            return _context22.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/member-roles/role-users/").concat(roleId), {
              query: params
            }));

          case 4:
          case "end":
            return _context22.stop();
        }
      }
    }, _callee22);
  }));
  return _queryOrganizationMemberRolesUsers.apply(this, arguments);
}

export function saveMembers(_x25, _x26) {
  return _saveMembers.apply(this, arguments);
}

function _saveMembers() {
  _saveMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee23(data, isEdit) {
    return _regeneratorRuntime.wrap(function _callee23$(_context23) {
      while (1) {
        switch (_context23.prev = _context23.next) {
          case 0:
            return _context23.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/member-roles/batch-assign"), {
              method: 'POST',
              body: data,
              query: {
                isEdit: isEdit
              }
            }));

          case 1:
          case "end":
            return _context23.stop();
        }
      }
    }, _callee23);
  }));
  return _saveMembers.apply(this, arguments);
}

export function saveOrganizationMembers(_x27, _x28, _x29) {
  return _saveOrganizationMembers.apply(this, arguments);
}

function _saveOrganizationMembers() {
  _saveOrganizationMembers = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee24(data, isEdit, organizationId) {
    return _regeneratorRuntime.wrap(function _callee24$(_context24) {
      while (1) {
        switch (_context24.prev = _context24.next) {
          case 0:
            return _context24.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/member-roles/batch-assign"), {
              method: 'POST',
              body: data,
              query: {
                isEdit: isEdit
              }
            }));

          case 1:
          case "end":
            return _context24.stop();
        }
      }
    }, _callee24);
  }));
  return _saveOrganizationMembers.apply(this, arguments);
}

export function deleteMember() {
  return _deleteMember.apply(this, arguments);
}

function _deleteMember() {
  _deleteMember = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
    var data,
        _args25 = arguments;
    return _regeneratorRuntime.wrap(function _callee25$(_context25) {
      while (1) {
        switch (_context25.prev = _context25.next) {
          case 0:
            data = _args25.length > 0 && _args25[0] !== undefined ? _args25[0] : {};
            return _context25.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/member-roles/batch-delete"), {
              method: 'DELETE',
              body: data
            }));

          case 2:
          case "end":
            return _context25.stop();
        }
      }
    }, _callee25);
  }));
  return _deleteMember.apply(this, arguments);
}

export function deleteOrganizationMember() {
  return _deleteOrganizationMember.apply(this, arguments);
}
/**
 * 查询角色已分配的客户端
 * @param {*} params
 */

function _deleteOrganizationMember() {
  _deleteOrganizationMember = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee26() {
    var data,
        organizationId,
        _args26 = arguments;
    return _regeneratorRuntime.wrap(function _callee26$(_context26) {
      while (1) {
        switch (_context26.prev = _context26.next) {
          case 0:
            data = _args26.length > 0 && _args26[0] !== undefined ? _args26[0] : {};
            organizationId = _args26.length > 1 ? _args26[1] : undefined;
            return _context26.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/member-roles/batch-delete"), {
              method: 'DELETE',
              body: data
            }));

          case 3:
          case "end":
            return _context26.stop();
        }
      }
    }, _callee26);
  }));
  return _deleteOrganizationMember.apply(this, arguments);
}

export function queryMemberRolesClients() {
  return _queryMemberRolesClients.apply(this, arguments);
}

function _queryMemberRolesClients() {
  _queryMemberRolesClients = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
    var params,
        roleId,
        _args27 = arguments;
    return _regeneratorRuntime.wrap(function _callee27$(_context27) {
      while (1) {
        switch (_context27.prev = _context27.next) {
          case 0:
            params = _args27.length > 0 && _args27[0] !== undefined ? _args27[0] : {};
            roleId = params.roleId;
            return _context27.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(memberRoleClient(), "/").concat(roleId), {
              query: parseParameters(params)
            }));

          case 3:
          case "end":
            return _context27.stop();
        }
      }
    }, _callee27);
  }));
  return _queryMemberRolesClients.apply(this, arguments);
}

export function deleteClient() {
  return _deleteClient.apply(this, arguments);
}

function _deleteClient() {
  _deleteClient = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
    var params,
        _args28 = arguments;
    return _regeneratorRuntime.wrap(function _callee28$(_context28) {
      while (1) {
        switch (_context28.prev = _context28.next) {
          case 0:
            params = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
            return _context28.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(clientDel()), {
              method: 'DELETE',
              body: params
            }));

          case 2:
          case "end":
            return _context28.stop();
        }
      }
    }, _callee28);
  }));
  return _deleteClient.apply(this, arguments);
}

export function saveClients(_x30) {
  return _saveClients.apply(this, arguments);
}

function _saveClients() {
  _saveClients = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee29(data) {
    return _regeneratorRuntime.wrap(function _callee29$(_context29) {
      while (1) {
        switch (_context29.prev = _context29.next) {
          case 0:
            return _context29.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(clientAdd), {
              method: 'POST',
              body: data
            }));

          case 1:
          case "end":
            return _context29.stop();
        }
      }
    }, _callee29);
  }));
  return _saveClients.apply(this, arguments);
}

export function queryRoleAuth(_x31) {
  return _queryRoleAuth.apply(this, arguments);
}

function _queryRoleAuth() {
  _queryRoleAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee30(params) {
    var roleId, body;
    return _regeneratorRuntime.wrap(function _callee30$(_context30) {
      while (1) {
        switch (_context30.prev = _context30.next) {
          case 0:
            roleId = params.roleId, body = params.body;
            return _context30.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/v1/").concat(tenantId, "/roles/").concat(roleId, "/role-auths/").concat(getCurrentOrganizationId()) : "".concat(CPAAS_IAM, "/v1/roles/").concat(roleId, "/role-auths/").concat(getCurrentOrganizationId()), {
              method: 'GET',
              query: body
            }));

          case 2:
          case "end":
            return _context30.stop();
        }
      }
    }, _callee30);
  }));
  return _queryRoleAuth.apply(this, arguments);
}

export function saveRoleAuth(_x32) {
  return _saveRoleAuth.apply(this, arguments);
}

function _saveRoleAuth() {
  _saveRoleAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee31(params) {
    var roleId, body;
    return _regeneratorRuntime.wrap(function _callee31$(_context31) {
      while (1) {
        switch (_context31.prev = _context31.next) {
          case 0:
            roleId = params.roleId, body = params.body;
            return _context31.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/v1/").concat(tenantId, "/roles/").concat(roleId, "/role-auths") : "".concat(CPAAS_IAM, "/v1/roles/").concat(roleId, "/role-auths"), {
              method: 'POST',
              body: body
            }));

          case 2:
          case "end":
            return _context31.stop();
        }
      }
    }, _callee31);
  }));
  return _saveRoleAuth.apply(this, arguments);
}

export function deleteRoleAuth(_x33) {
  return _deleteRoleAuth.apply(this, arguments);
}
/**
 * 查询角色可分配权限的菜单子树
 * @async
 * @function queryPermissionMenus
 * @param {!object} params - 保存参数
 * @returns {object} fetch Promise
 */

function _deleteRoleAuth() {
  _deleteRoleAuth = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee32(params) {
    var roleId, body;
    return _regeneratorRuntime.wrap(function _callee32$(_context32) {
      while (1) {
        switch (_context32.prev = _context32.next) {
          case 0:
            roleId = params.roleId, body = params.body;
            return _context32.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/v1/").concat(tenantId, "/roles/").concat(roleId, "/role-auths?").concat(qs.stringify({
              roleAuthId: body.roleAuthId
            })) : "".concat(CPAAS_IAM, "/v1/roles/").concat(roleId, "/role-auths?").concat(qs.stringify({
              roleAuthId: body.roleAuthId
            })), {
              method: 'DELETE',
              body: body
            }));

          case 2:
          case "end":
            return _context32.stop();
        }
      }
    }, _callee32);
  }));
  return _deleteRoleAuth.apply(this, arguments);
}

export function queryPermissionMenus(_x34, _x35) {
  return _queryPermissionMenus.apply(this, arguments);
}
/**
 * 批量分配权限集至角色
 * @async
 * @function batchAssignPermissionSets
 * @param {!object} params - 保存参数
 * @param {!number} roleId - 角色ID
 * @returns {object} fetch Promise
 */

function _queryPermissionMenus() {
  _queryPermissionMenus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee33(roleId, params) {
    return _regeneratorRuntime.wrap(function _callee33$(_context33) {
      while (1) {
        switch (_context33.prev = _context33.next) {
          case 0:
            return _context33.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/cpaas/v1/").concat(tenantId, "/roles/").concat(roleId, "/permission-set-tree") : "".concat(CPAAS_IAM, "/cpaas/v1/roles/").concat(roleId, "/permission-set-tree"), {
              query: params
            }));

          case 1:
          case "end":
            return _context33.stop();
        }
      }
    }, _callee33);
  }));
  return _queryPermissionMenus.apply(this, arguments);
}

export function batchAssignPermissionSets(_x36, _x37) {
  return _batchAssignPermissionSets.apply(this, arguments);
}
/**
 * 批量分配权限集至角色 - 租户级
 * @async
 * @function batchAssignPermissionSets
 * @param {!object} params - 保存参数
 * @param {!number} roleId - 角色ID
 * @returns {object} fetch Promise
 */

function _batchAssignPermissionSets() {
  _batchAssignPermissionSets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee34(roleId, data) {
    return _regeneratorRuntime.wrap(function _callee34$(_context34) {
      while (1) {
        switch (_context34.prev = _context34.next) {
          case 0:
            return _context34.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles/").concat(roleId, "/permission-sets/assign"), {
              method: 'PUT',
              body: data
            }));

          case 1:
          case "end":
            return _context34.stop();
        }
      }
    }, _callee34);
  }));
  return _batchAssignPermissionSets.apply(this, arguments);
}

export function batchAssignOrganizationPermissionSets(_x38, _x39, _x40) {
  return _batchAssignOrganizationPermissionSets.apply(this, arguments);
}
/**
 * 批量取消分配权限集至角色
 * @async
 * @function batchAssignPermissionSets
 * @param {!object} params - 保存参数
 * @param {!number} roleId - 角色ID
 * @returns {object} fetch Promise
 */

function _batchAssignOrganizationPermissionSets() {
  _batchAssignOrganizationPermissionSets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee35(roleId, data, organizationId) {
    return _regeneratorRuntime.wrap(function _callee35$(_context35) {
      while (1) {
        switch (_context35.prev = _context35.next) {
          case 0:
            return _context35.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/roles/").concat(roleId, "/permission-sets/assign"), {
              method: 'PUT',
              body: data
            }));

          case 1:
          case "end":
            return _context35.stop();
        }
      }
    }, _callee35);
  }));
  return _batchAssignOrganizationPermissionSets.apply(this, arguments);
}

export function batchUnassignPermissionSets(_x41, _x42) {
  return _batchUnassignPermissionSets.apply(this, arguments);
}
/**
 * 批量取消分配权限集至角色 - 租户级
 * @async
 * @function batchAssignPermissionSets
 * @param {!object} params - 保存参数
 * @param {!number} roleId - 角色ID
 * @returns {object} fetch Promise
 */

function _batchUnassignPermissionSets() {
  _batchUnassignPermissionSets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee36(roleId, data) {
    return _regeneratorRuntime.wrap(function _callee36$(_context36) {
      while (1) {
        switch (_context36.prev = _context36.next) {
          case 0:
            return _context36.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles/").concat(roleId, "/permission-sets/recycle"), {
              method: 'PUT',
              body: data
            }));

          case 1:
          case "end":
            return _context36.stop();
        }
      }
    }, _callee36);
  }));
  return _batchUnassignPermissionSets.apply(this, arguments);
}

export function batchUnassignOrganizationPermissionSets(_x43, _x44, _x45) {
  return _batchUnassignOrganizationPermissionSets.apply(this, arguments);
}
/**
 * 批量取消分配明细权限
 * @async
 * @function unassignOrganizationPermissions
 * @param {!object} params - 保存参数
 * @param {!number} roleId - 角色ID
 * @returns {object} fetch Promise
 */

function _batchUnassignOrganizationPermissionSets() {
  _batchUnassignOrganizationPermissionSets = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee37(roleId, data, organizationId) {
    return _regeneratorRuntime.wrap(function _callee37$(_context37) {
      while (1) {
        switch (_context37.prev = _context37.next) {
          case 0:
            return _context37.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/roles/").concat(roleId, "/permission-sets/recycle"), {
              method: 'PUT',
              body: data
            }));

          case 1:
          case "end":
            return _context37.stop();
        }
      }
    }, _callee37);
  }));
  return _batchUnassignOrganizationPermissionSets.apply(this, arguments);
}

export function unassignOrganizationPermissions(_x46, _x47, _x48) {
  return _unassignOrganizationPermissions.apply(this, arguments);
}
/**
 * 组织层查询当前登录用户默认角色
 * @async
 * @function queryCurrentRole
 * @returns {object} fetch Promise
 */

function _unassignOrganizationPermissions() {
  _unassignOrganizationPermissions = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee38(roleId, data, organizationId) {
    return _regeneratorRuntime.wrap(function _callee38$(_context38) {
      while (1) {
        switch (_context38.prev = _context38.next) {
          case 0:
            return _context38.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/").concat(organizationId, "/roles/").concat(roleId, "/permissions/unassign"), {
              method: 'PUT',
              body: data,
              responseType: 'text'
            }));

          case 1:
          case "end":
            return _context38.stop();
        }
      }
    }, _callee38);
  }));
  return _unassignOrganizationPermissions.apply(this, arguments);
}

export function queryCurrentRole() {
  return _queryCurrentRole.apply(this, arguments);
}
/**
 * 分页查查询角色信息
 * @async
 * @function queryCreatedSubroles
 * @param {object} params - 查询条件
 * @param {!number} [params.page = 0] - 数据页码
 * @param {!number} [params.size = 10] - 分页大小
 * @returns {object} fetch Promise
 */

function _queryCurrentRole() {
  _queryCurrentRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee39() {
    return _regeneratorRuntime.wrap(function _callee39$(_context39) {
      while (1) {
        switch (_context39.prev = _context39.next) {
          case 0:
            return _context39.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/member-roles/current-role")));

          case 1:
          case "end":
            return _context39.stop();
        }
      }
    }, _callee39);
  }));
  return _queryCurrentRole.apply(this, arguments);
}

export function queryCreatedSubroles() {
  return _queryCreatedSubroles.apply(this, arguments);
}
/* 角色分配卡片 */

/**
 * 查询角色分配的卡片
 * @requestUrl {CPAAS_PLATFORM}/v1/dashboard-role-cards/{roleId}
 * @requestMethod GET
 * @param {object} - page - 分页信息
 * @param {object} - sort - 排序信息
 * @param {number} - roleId - 角色id
 */

function _queryCreatedSubroles() {
  _queryCreatedSubroles = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee40() {
    var params,
        query,
        _args40 = arguments;
    return _regeneratorRuntime.wrap(function _callee40$(_context40) {
      while (1) {
        switch (_context40.prev = _context40.next) {
          case 0:
            params = _args40.length > 0 && _args40[0] !== undefined ? _args40[0] : {};
            query = filterNullValueObject(parseParameters(params));
            return _context40.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles/self/manageable-roles"), {
              query: query
            }));

          case 3:
          case "end":
            return _context40.stop();
        }
      }
    }, _callee40);
  }));
  return _queryCreatedSubroles.apply(this, arguments);
}

export function roleCardsQuery(_x49) {
  return _roleCardsQuery.apply(this, arguments);
}
/**
 * 删除角色分配的卡片
 * @requestUrl {CPAAS_PLATFORM}/v1/dashboard-role-cards
 * @requestMethod DELETE
 * @param {object[]} - params - 删除的卡片信息
 */

function _roleCardsQuery() {
  _roleCardsQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee41(params) {
    var roleId, restParams, parsedParams;
    return _regeneratorRuntime.wrap(function _callee41$(_context41) {
      while (1) {
        switch (_context41.prev = _context41.next) {
          case 0:
            roleId = params.roleId, restParams = _objectWithoutProperties(params, _excluded2);
            parsedParams = parseParameters(restParams);
            return _context41.abrupt("return", request("".concat(CPAAS_PLATFORM, "/v1/dashboard-role-cards/").concat(roleId), {
              method: 'GET',
              query: parsedParams
            }));

          case 3:
          case "end":
            return _context41.stop();
        }
      }
    }, _callee41);
  }));
  return _roleCardsQuery.apply(this, arguments);
}

export function roleCardsDelete(_x50) {
  return _roleCardsDelete.apply(this, arguments);
}
/**
 * 新增或修改角色分配的卡片
 * @requestUrl {CPAAS_PLATFORM}/v1/dashboard-role-cards
 * @requestMethod POST
 * @param {object[]} - params - 删除的卡片信息
 */

function _roleCardsDelete() {
  _roleCardsDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee42(params) {
    return _regeneratorRuntime.wrap(function _callee42$(_context42) {
      while (1) {
        switch (_context42.prev = _context42.next) {
          case 0:
            return _context42.abrupt("return", request("".concat(CPAAS_PLATFORM, "/v1/dashboard-role-cards"), {
              method: 'DELETE',
              body: params
            }));

          case 1:
          case "end":
            return _context42.stop();
        }
      }
    }, _callee42);
  }));
  return _roleCardsDelete.apply(this, arguments);
}

export function roleCardsInsertOrUpdate(_x51) {
  return _roleCardsInsertOrUpdate.apply(this, arguments);
}
/* 角色分配卡片 租户级 */

/**
 * 查询角色分配的卡片
 * @requestUrl {CPAAS_PLATFORM}/v1/{organizationId}/dashboard-role-cards/{roleId}
 * @requestMethod GET
 * @param {object} - page - 分页信息
 * @param {object} - sort - 排序信息
 * @param {number} - roleId - 角色id
 */

function _roleCardsInsertOrUpdate() {
  _roleCardsInsertOrUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee43(params) {
    return _regeneratorRuntime.wrap(function _callee43$(_context43) {
      while (1) {
        switch (_context43.prev = _context43.next) {
          case 0:
            return _context43.abrupt("return", request("".concat(CPAAS_PLATFORM, "/v1/dashboard-role-cards"), {
              method: 'POST',
              body: params
            }));

          case 1:
          case "end":
            return _context43.stop();
        }
      }
    }, _callee43);
  }));
  return _roleCardsInsertOrUpdate.apply(this, arguments);
}

export function orgRoleCardsQuery(_x52, _x53) {
  return _orgRoleCardsQuery.apply(this, arguments);
}
/**
 * 删除角色分配的卡片
 * @requestUrl {CPAAS_PLATFORM}/v1/{organizationId}/dashboard-role-cards
 * @requestMethod DELETE
 * @param {object[]} - params - 删除的卡片信息
 */

function _orgRoleCardsQuery() {
  _orgRoleCardsQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee44(organizationId, params) {
    var roleId, restParams, parsedParams;
    return _regeneratorRuntime.wrap(function _callee44$(_context44) {
      while (1) {
        switch (_context44.prev = _context44.next) {
          case 0:
            roleId = params.roleId, restParams = _objectWithoutProperties(params, _excluded3);
            parsedParams = parseParameters(restParams);
            return _context44.abrupt("return", request("".concat(CPAAS_PLATFORM, "/v1/").concat(organizationId, "/dashboard-role-cards/").concat(roleId), {
              method: 'GET',
              query: parsedParams
            }));

          case 3:
          case "end":
            return _context44.stop();
        }
      }
    }, _callee44);
  }));
  return _orgRoleCardsQuery.apply(this, arguments);
}

export function orgRoleCardsDelete(_x54, _x55) {
  return _orgRoleCardsDelete.apply(this, arguments);
}
/**
 * 新增或修改角色分配的卡片
 * @requestUrl {CPAAS_PLATFORM}/v1/{organizationId}/dashboard-role-cards
 * @requestMethod POST
 * @param {object[]} - params - 删除的卡片信息
 */

function _orgRoleCardsDelete() {
  _orgRoleCardsDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee45(organizationId, params) {
    return _regeneratorRuntime.wrap(function _callee45$(_context45) {
      while (1) {
        switch (_context45.prev = _context45.next) {
          case 0:
            return _context45.abrupt("return", request("".concat(CPAAS_PLATFORM, "/v1/").concat(organizationId, "/dashboard-role-cards"), {
              method: 'DELETE',
              body: params
            }));

          case 1:
          case "end":
            return _context45.stop();
        }
      }
    }, _callee45);
  }));
  return _orgRoleCardsDelete.apply(this, arguments);
}

export function orgRoleCardsInsertOrUpdate(_x56, _x57) {
  return _orgRoleCardsInsertOrUpdate.apply(this, arguments);
}
/**
 * @async
 * @function queryTenant - 查询用户租户列表数据
 */

function _orgRoleCardsInsertOrUpdate() {
  _orgRoleCardsInsertOrUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee46(organizationId, params) {
    return _regeneratorRuntime.wrap(function _callee46$(_context46) {
      while (1) {
        switch (_context46.prev = _context46.next) {
          case 0:
            return _context46.abrupt("return", request("".concat(CPAAS_PLATFORM, "/v1/").concat(organizationId, "/dashboard-role-cards"), {
              method: 'POST',
              body: params
            }));

          case 1:
          case "end":
            return _context46.stop();
        }
      }
    }, _callee46);
  }));
  return _orgRoleCardsInsertOrUpdate.apply(this, arguments);
}

export function queryCurrentTenants() {
  return _queryCurrentTenants.apply(this, arguments);
}

function _queryCurrentTenants() {
  _queryCurrentTenants = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee47() {
    return _regeneratorRuntime.wrap(function _callee47$(_context47) {
      while (1) {
        switch (_context47.prev = _context47.next) {
          case 0:
            return _context47.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/users/self-tenants"), {
              method: 'GET'
            }));

          case 1:
          case "end":
            return _context47.stop();
        }
      }
    }, _callee47);
  }));
  return _queryCurrentTenants.apply(this, arguments);
}

export function queryAdminRole(_x58) {
  return _queryAdminRole.apply(this, arguments);
}
/**
 * 接口字段维护 服务
 * apiFieldService
 * @date 2019-07-09
 */

/**
 * 接口 model 不能修改
 * @typedef {object} API
 * @property {number} fieldPermissionId - 主键
 * @property {number} fieldId - 字段id
 * @property {string} permissionType - 权限类型 值集
 * @property {string} permissionRule - 权限规则 值集
 * @property {string} permissionDimension - 权限维度 值集
 * @property {number} dimensionValue - 权限维度值
 */

/**
 * @description 字段权限 model 可以 查增改删
 * @typedef {Object} FIELD_PERMISSION
 * @property {number} fieldId - 主键
 * @property {string} fieldDescription - 字段描述 480
 * @property {string} fieldName - 字段名称 120
 * @property {string} fieldType - 字段类型 值集
 * @property {number} orderSeq - 排序
 * @property {number} permissionId - 接口id
 */

/**
 * @typedef {Object} Page<T>
 * @property {number} number - 分页
 * @property {number} size - 分页大小
 * @property {number} totalElements - 总数据量
 * @property {T[]} content - 数据
 */

/**
 * @typedef {Object} PageInfo
 * @property {number} page - 分页
 * @property {number} size - 分页大小
 */

/**
 * 查询接口
 * @param params
 * @return {Promise<API[]>}
 */

function _queryAdminRole() {
  _queryAdminRole = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee48(roleId) {
    return _regeneratorRuntime.wrap(function _callee48$(_context48) {
      while (1) {
        switch (_context48.prev = _context48.next) {
          case 0:
            return _context48.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles/admin-role/").concat(roleId), {
              method: 'GET'
            }));

          case 1:
          case "end":
            return _context48.stop();
        }
      }
    }, _callee48);
  }));
  return _queryAdminRole.apply(this, arguments);
}

export function apiFieldApiQuery(_x59) {
  return _apiFieldApiQuery.apply(this, arguments);
}
/**
 * 查询搜索字段-标签 数据
 * @export
 * @param {*} param
 * @returns
 */

function _apiFieldApiQuery() {
  _apiFieldApiQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee49(params) {
    var query;
    return _regeneratorRuntime.wrap(function _callee49$(_context49) {
      while (1) {
        switch (_context49.prev = _context49.next) {
          case 0:
            query = parseParameters(params);
            return _context49.abrupt("return", request("".concat(CPAAS_IAM, "/v1/").concat(getCurrentOrganizationId(), "/apis"), {
              method: 'GET',
              query: query
            }));

          case 2:
          case "end":
            return _context49.stop();
        }
      }
    }, _callee49);
  }));
  return _apiFieldApiQuery.apply(this, arguments);
}

export function querySearchLabels(_x60) {
  return _querySearchLabels.apply(this, arguments);
}
/**
 * 查询对应接口的字段权限
 * @param {number} roleId - 角色id
 * @param {number} permissionId - 接口id
 * @param {PageInfo} params - 查询分页参数
 * @param {FIELD_PERMISSION} params - 查询实体
 * @return {Promise<API[]>}
 */

function _querySearchLabels() {
  _querySearchLabels = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee50(param) {
    return _regeneratorRuntime.wrap(function _callee50$(_context50) {
      while (1) {
        switch (_context50.prev = _context50.next) {
          case 0:
            return _context50.abrupt("return", request(organizationRoleLevel ? "".concat(CPAAS_IAM, "/v1/").concat(tenantId, "/labels/by-type") : "".concat(CPAAS_IAM, "/v1/labels/by-type"), {
              method: 'GET',
              query: param
            }));

          case 1:
          case "end":
            return _context50.stop();
        }
      }
    }, _callee50);
  }));
  return _querySearchLabels.apply(this, arguments);
}

export function apiFieldFieldPermissionQuery(_x61, _x62, _x63) {
  return _apiFieldFieldPermissionQuery.apply(this, arguments);
}
/**
 * 修改对应接口的字段权限
 * @param {number} roleId - 角色id
 * @param {number} permissionId - 接口id
 * @param {FIELD_PERMISSION} record - 修改实体
 */

function _apiFieldFieldPermissionQuery() {
  _apiFieldFieldPermissionQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee51(roleId, permissionId, params) {
    var query;
    return _regeneratorRuntime.wrap(function _callee51$(_context51) {
      while (1) {
        switch (_context51.prev = _context51.next) {
          case 0:
            query = parseParameters(params);
            return _context51.abrupt("return", request("".concat(CPAAS_IAM, "/v1/").concat(getCurrentOrganizationId(), "/apis/").concat(permissionId, "/role/").concat(roleId), {
              method: 'GET',
              query: query
            }));

          case 2:
          case "end":
            return _context51.stop();
        }
      }
    }, _callee51);
  }));
  return _apiFieldFieldPermissionQuery.apply(this, arguments);
}

export function apiFieldFieldPermissionUpdate(_x64, _x65, _x66) {
  return _apiFieldFieldPermissionUpdate.apply(this, arguments);
}
/**
 * 新增对应接口的字段权限
 * @param {number} roleId - 角色id
 * @param {number} permissionId - 接口id
 * @param {FIELD_PERMISSION} record - 修改实体
 */

function _apiFieldFieldPermissionUpdate() {
  _apiFieldFieldPermissionUpdate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee52(roleId, permissionId, record) {
    return _regeneratorRuntime.wrap(function _callee52$(_context52) {
      while (1) {
        switch (_context52.prev = _context52.next) {
          case 0:
            return _context52.abrupt("return", request("".concat(CPAAS_IAM, "/v1/").concat(getCurrentOrganizationId(), "/apis/").concat(permissionId, "/role/").concat(roleId), {
              method: 'PUT',
              body: record
            }));

          case 1:
          case "end":
            return _context52.stop();
        }
      }
    }, _callee52);
  }));
  return _apiFieldFieldPermissionUpdate.apply(this, arguments);
}

export function apiFieldFieldPermissionCreate(_x67, _x68, _x69) {
  return _apiFieldFieldPermissionCreate.apply(this, arguments);
}
/**
 * 删除对应接口的字段权限
 * @param {number} permissionId - 接口id
 * @param {FIELD_PERMISSION} record - 修改实体
 */

function _apiFieldFieldPermissionCreate() {
  _apiFieldFieldPermissionCreate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee53(roleId, permissionId, record) {
    return _regeneratorRuntime.wrap(function _callee53$(_context53) {
      while (1) {
        switch (_context53.prev = _context53.next) {
          case 0:
            return _context53.abrupt("return", request("".concat(CPAAS_IAM, "/v1/").concat(getCurrentOrganizationId(), "/apis/").concat(permissionId, "/role/").concat(roleId), {
              method: 'POST',
              body: record
            }));

          case 1:
          case "end":
            return _context53.stop();
        }
      }
    }, _callee53);
  }));
  return _apiFieldFieldPermissionCreate.apply(this, arguments);
}

export function apiFieldFieldPermissionRemove(_x70, _x71) {
  return _apiFieldFieldPermissionRemove.apply(this, arguments);
}
/**
 * 查询树形列表
 * @param {number} parentRoleId - 父级节点角色ID
 */

function _apiFieldFieldPermissionRemove() {
  _apiFieldFieldPermissionRemove = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee54(permissionId, record) {
    return _regeneratorRuntime.wrap(function _callee54$(_context54) {
      while (1) {
        switch (_context54.prev = _context54.next) {
          case 0:
            return _context54.abrupt("return", request("".concat(CPAAS_IAM, "/v1/").concat(getCurrentOrganizationId(), "/apis/").concat(permissionId, "/permission"), {
              method: 'DELETE',
              body: record
            }));

          case 1:
          case "end":
            return _context54.stop();
        }
      }
    }, _callee54);
  }));
  return _apiFieldFieldPermissionRemove.apply(this, arguments);
}

export function queryRoleTree(_x72) {
  return _queryRoleTree.apply(this, arguments);
}
/**
 * 条件查询树形列表
 * @param {object} params - 查询参数
 */

function _queryRoleTree() {
  _queryRoleTree = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee55(params) {
    var param;
    return _regeneratorRuntime.wrap(function _callee55$(_context55) {
      while (1) {
        switch (_context55.prev = _context55.next) {
          case 0:
            param = filterNullValueObject(parseParameters(params));
            return _context55.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles/self/manageable-roles/tree/sub"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 2:
          case "end":
            return _context55.stop();
        }
      }
    }, _callee55);
  }));
  return _queryRoleTree.apply(this, arguments);
}

export function queryRoleTreeAll(_x73) {
  return _queryRoleTreeAll.apply(this, arguments);
}

function _queryRoleTreeAll() {
  _queryRoleTreeAll = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee56(params) {
    var param;
    return _regeneratorRuntime.wrap(function _callee56$(_context56) {
      while (1) {
        switch (_context56.prev = _context56.next) {
          case 0:
            param = parseParameters(params);
            return _context56.abrupt("return", request("".concat(CPAAS_IAM, "/cpaas/v1/roles/self/manageable-roles/tree"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 2:
          case "end":
            return _context56.stop();
        }
      }
    }, _callee56);
  }));
  return _queryRoleTreeAll.apply(this, arguments);
}

export function queryRoleCard(_x74) {
  return _queryRoleCard.apply(this, arguments);
}
/**
 * 查询已分配的安全组
 * @param {object} params - 查询参数
 */

function _queryRoleCard() {
  _queryRoleCard = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee57(params) {
    var param;
    return _regeneratorRuntime.wrap(function _callee57$(_context57) {
      while (1) {
        switch (_context57.prev = _context57.next) {
          case 0:
            param = parseParameters(params);
            return _context57.abrupt("return", request(isTenantRoleLevel() ? "".concat(CPAAS_PLATFORM, "/v1/").concat(tenantId, "/dashboard-role-cards/role-assign-card") : "".concat(CPAAS_PLATFORM, "/v1/dashboard-role-cards/role-assign-card"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 2:
          case "end":
            return _context57.stop();
        }
      }
    }, _callee57);
  }));
  return _queryRoleCard.apply(this, arguments);
}

export function querySecurityGroup(_x75) {
  return _querySecurityGroup.apply(this, arguments);
}
/**
 * 查询可分配的安全组
 * @param {object} params - 查询参数
 */

function _querySecurityGroup() {
  _querySecurityGroup = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee58(params) {
    var roleId, param;
    return _regeneratorRuntime.wrap(function _callee58$(_context58) {
      while (1) {
        switch (_context58.prev = _context58.next) {
          case 0:
            roleId = params.roleId;
            param = parseParameters(params);
            return _context58.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/assigned-sec-grp"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 3:
          case "end":
            return _context58.stop();
        }
      }
    }, _callee58);
  }));
  return _querySecurityGroup.apply(this, arguments);
}

export function queryAssignableSecGrp(_x76) {
  return _queryAssignableSecGrp.apply(this, arguments);
}
/**
 * 角色分配安全组
 * @param {number} roleId - 角色id
 * @param {number} permissionId - 接口id
 * @param {FIELD_PERMISSION} record - 修改实体
 */

function _queryAssignableSecGrp() {
  _queryAssignableSecGrp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee59(params) {
    var roleId, param;
    return _regeneratorRuntime.wrap(function _callee59$(_context59) {
      while (1) {
        switch (_context59.prev = _context59.next) {
          case 0:
            roleId = params.roleId;
            param = parseParameters(params);
            return _context59.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/assignable-sec-grp"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 3:
          case "end":
            return _context59.stop();
        }
      }
    }, _callee59);
  }));
  return _queryAssignableSecGrp.apply(this, arguments);
}

export function assignSecGrp(_x77, _x78) {
  return _assignSecGrp.apply(this, arguments);
}
/**
 * 角色取消分配安全组
 * @param {object} payload - 删除的安全组集合
 */

function _assignSecGrp() {
  _assignSecGrp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee60(secGrpList, roleId) {
    return _regeneratorRuntime.wrap(function _callee60$(_context60) {
      while (1) {
        switch (_context60.prev = _context60.next) {
          case 0:
            return _context60.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/assign-sec-grp"), {
              method: 'POST',
              body: secGrpList
            }));

          case 1:
          case "end":
            return _context60.stop();
        }
      }
    }, _callee60);
  }));
  return _assignSecGrp.apply(this, arguments);
}

export function deleteSecGrp(_x79) {
  return _deleteSecGrp.apply(this, arguments);
}
/**
 * 查询角色已分配的指定安全组的访问权限
 * @param {number} roleId - 角色ID
 * @param {number} secGrpId - 安全组ID
 */

function _deleteSecGrp() {
  _deleteSecGrp = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee61(payload) {
    var roleId, secGrpList;
    return _regeneratorRuntime.wrap(function _callee61$(_context61) {
      while (1) {
        switch (_context61.prev = _context61.next) {
          case 0:
            roleId = payload.roleId, secGrpList = payload.secGrpList;
            return _context61.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/recycle-sec-grp"), {
              method: 'DELETE',
              body: secGrpList
            }));

          case 2:
          case "end":
            return _context61.stop();
        }
      }
    }, _callee61);
  }));
  return _deleteSecGrp.apply(this, arguments);
}

export function querySecGrpPermissionMenus(_x80, _x81) {
  return _querySecGrpPermissionMenus.apply(this, arguments);
}
/**
 * 查询角色已分配的指定安全组的字段权限
 * @param {object} params - 请求参数
 */

function _querySecGrpPermissionMenus() {
  _querySecGrpPermissionMenus = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee62(roleId, secGrpId) {
    return _regeneratorRuntime.wrap(function _callee62$(_context62) {
      while (1) {
        switch (_context62.prev = _context62.next) {
          case 0:
            return _context62.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/").concat(secGrpId, "/acl")));

          case 1:
          case "end":
            return _context62.stop();
        }
      }
    }, _callee62);
  }));
  return _querySecGrpPermissionMenus.apply(this, arguments);
}

export function queryFieldPermission(_x82) {
  return _queryFieldPermission.apply(this, arguments);
}
/**
 * 查询角色已分配的指定安全组的字段权限配置
 * @param {number} params - 请求参数
 */

function _queryFieldPermission() {
  _queryFieldPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee63(params) {
    var roleId, secGrpId, param;
    return _regeneratorRuntime.wrap(function _callee63$(_context63) {
      while (1) {
        switch (_context63.prev = _context63.next) {
          case 0:
            roleId = params.roleId, secGrpId = params.secGrpId;
            param = parseParameters(params);
            return _context63.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/").concat(secGrpId, "/field-api"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 3:
          case "end":
            return _context63.stop();
        }
      }
    }, _callee63);
  }));
  return _queryFieldPermission.apply(this, arguments);
}

export function queryFieldConfig(_x83) {
  return _queryFieldConfig.apply(this, arguments);
}
/**
 * 查询角色已分配的指定安全组的工作台配置
 * @param {object} params - 请求参数
 */

function _queryFieldConfig() {
  _queryFieldConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee64(params) {
    var roleId, secGrpId, permissionId, param;
    return _regeneratorRuntime.wrap(function _callee64$(_context64) {
      while (1) {
        switch (_context64.prev = _context64.next) {
          case 0:
            roleId = params.roleId, secGrpId = params.secGrpId, permissionId = params.permissionId;
            param = parseParameters(params);
            return _context64.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/").concat(secGrpId, "/field-api/").concat(permissionId, "/fields"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 3:
          case "end":
            return _context64.stop();
        }
      }
    }, _callee64);
  }));
  return _queryFieldConfig.apply(this, arguments);
}

export function queryCardPermission(_x84) {
  return _queryCardPermission.apply(this, arguments);
}
/**
 * 查询角色已分配的指定安全组的数据权限维度
 * @param {object} params - 请求参数
 */

function _queryCardPermission() {
  _queryCardPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee65(params) {
    var roleId, secGrpId, param;
    return _regeneratorRuntime.wrap(function _callee65$(_context65) {
      while (1) {
        switch (_context65.prev = _context65.next) {
          case 0:
            roleId = params.roleId, secGrpId = params.secGrpId;
            param = parseParameters(params);
            return _context65.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/").concat(secGrpId, "/dashboard"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 3:
          case "end":
            return _context65.stop();
        }
      }
    }, _callee65);
  }));
  return _queryCardPermission.apply(this, arguments);
}

export function queryDataDimension(_x85) {
  return _queryDataDimension.apply(this, arguments);
}
/**
 * 查询安全组数据权限tab页
 * @param {number} secGrpId - 安全组ID
 */

function _queryDataDimension() {
  _queryDataDimension = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee66(params) {
    var roleId, secGrpId, param;
    return _regeneratorRuntime.wrap(function _callee66$(_context66) {
      while (1) {
        switch (_context66.prev = _context66.next) {
          case 0:
            roleId = params.roleId, secGrpId = params.secGrpId;
            param = parseParameters(params);
            return _context66.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/").concat(secGrpId, "/dim"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 3:
          case "end":
            return _context66.stop();
        }
      }
    }, _callee66);
  }));
  return _queryDataDimension.apply(this, arguments);
}

export function queryTabList(_x86) {
  return _queryTabList.apply(this, arguments);
}
/**
 * 查询角色已分配的指定安全组的数据权限-除公司外
 * @param {object} params - 请求参数
 */

function _queryTabList() {
  _queryTabList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee67(secGrpId) {
    return _regeneratorRuntime.wrap(function _callee67$(_context67) {
      while (1) {
        switch (_context67.prev = _context67.next) {
          case 0:
            return _context67.abrupt("return", request("".concat(CPAAS_IAM, "/v1/sec-grp-dcls/").concat(secGrpId, "/dims/assigned")));

          case 1:
          case "end":
            return _context67.stop();
        }
      }
    }, _callee67);
  }));
  return _queryTabList.apply(this, arguments);
}

export function queryData(_x87) {
  return _queryData.apply(this, arguments);
}
/**
 * 查询角色已分配的指定安全组的数据权限-公司
 * @param {object} params - 请求参数
 */

function _queryData() {
  _queryData = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee68(params) {
    var roleId, secGrpId, param;
    return _regeneratorRuntime.wrap(function _callee68$(_context68) {
      while (1) {
        switch (_context68.prev = _context68.next) {
          case 0:
            roleId = params.roleId, secGrpId = params.secGrpId;
            param = parseParameters(params);
            return _context68.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/").concat(secGrpId, "/dcl"), {
              method: 'GET',
              query: _objectSpread({}, param)
            }));

          case 3:
          case "end":
            return _context68.stop();
        }
      }
    }, _callee68);
  }));
  return _queryData.apply(this, arguments);
}

export function queryCompanyPermission(_x88) {
  return _queryCompanyPermission.apply(this, arguments);
}
/**
 * 屏蔽安全组权限
 * @param {object} payload - 请求数据
 */

function _queryCompanyPermission() {
  _queryCompanyPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee69(params) {
    var roleId, secGrpId, param;
    return _regeneratorRuntime.wrap(function _callee69$(_context69) {
      while (1) {
        switch (_context69.prev = _context69.next) {
          case 0:
            roleId = params.roleId, secGrpId = params.secGrpId;
            param = parseParameters(params);
            return _context69.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/").concat(secGrpId, "/dcl"), {
              method: 'GET',
              query: param
            }));

          case 3:
          case "end":
            return _context69.stop();
        }
      }
    }, _callee69);
  }));
  return _queryCompanyPermission.apply(this, arguments);
}

export function shieldSecGrpPermission(_x89) {
  return _shieldSecGrpPermission.apply(this, arguments);
}
/**
 * 取消屏蔽安全组权限
 * @param {object} payload - 请求数据
 */

function _shieldSecGrpPermission() {
  _shieldSecGrpPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee70(payload) {
    var roleId, secGrpId, rest, queryString;
    return _regeneratorRuntime.wrap(function _callee70$(_context70) {
      while (1) {
        switch (_context70.prev = _context70.next) {
          case 0:
            roleId = payload.roleId, secGrpId = payload.secGrpId, rest = _objectWithoutProperties(payload, _excluded4);
            queryString = qs.stringify(rest);
            return _context70.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/").concat(secGrpId, "/shield?").concat(queryString), {
              method: 'POST'
            }));

          case 3:
          case "end":
            return _context70.stop();
        }
      }
    }, _callee70);
  }));
  return _shieldSecGrpPermission.apply(this, arguments);
}

export function cancelShieldSecGrpPermission(_x90) {
  return _cancelShieldSecGrpPermission.apply(this, arguments);
}

function _cancelShieldSecGrpPermission() {
  _cancelShieldSecGrpPermission = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee71(payload) {
    var roleId, secGrpId, rest, queryString;
    return _regeneratorRuntime.wrap(function _callee71$(_context71) {
      while (1) {
        switch (_context71.prev = _context71.next) {
          case 0:
            roleId = payload.roleId, secGrpId = payload.secGrpId, rest = _objectWithoutProperties(payload, _excluded5);
            queryString = qs.stringify(rest);
            return _context71.abrupt("return", request("".concat(CPAAS_IAM, "/").concat(secGrp, "/").concat(roleId, "/").concat(secGrpId, "/cancel-shield?").concat(queryString), {
              method: 'POST'
            }));

          case 3:
          case "end":
            return _context71.stop();
        }
      }
    }, _callee71);
  }));
  return _cancelShieldSecGrpPermission.apply(this, arguments);
}